home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / program / 562 / perl4_10.zoo / atarist.c next >
Encoding:
C/C++ Source or Header  |  1991-10-09  |  1.1 KB  |  69 lines

  1. /*
  2.  * random stuff for atariST
  3.  */
  4.  
  5. #include "EXTERN.h"
  6. #include "perl.h"
  7. #include <process.h>
  8.  
  9. long _stksize = 64*1024L;
  10. unsigned long __DEFAULT_BUFSIZ__ = 8 * 1024L;
  11.  
  12. /*
  13.  * The following code is based on the do_exec and do_aexec functions
  14.  * in file doio.c
  15.  */
  16. int
  17. do_aspawn(really,arglast)
  18. STR *really;
  19. int *arglast;
  20. {
  21.     register STR **st = stack->ary_array;
  22.     register int sp = arglast[1];
  23.     register int items = arglast[2] - sp;
  24.     register char **a;
  25.     char **argv;
  26.     char *tmps;
  27.     int status;
  28.  
  29.     if (items) {
  30.     New(1101,argv, items+1, char*);
  31.     a = argv;
  32.     for (st += ++sp; items > 0; items--,st++) {
  33.         if (*st)
  34.         *a++ = str_get(*st);
  35.         else
  36.         *a++ = "";
  37.     }
  38.     *a = Nullch;
  39.     if (really && *(tmps = str_get(really)))
  40.         status = spawnvp(-P_WAIT,tmps,argv); /* -P_WAIT is a hack, see spawnvp.c in the lib */
  41.     else
  42.         status = spawnvp(-P_WAIT,argv[0],argv);
  43.     Safefree(argv);
  44.     }
  45.     return status;
  46. }
  47.  
  48.  
  49. int
  50. do_spawn(cmd)
  51. char *cmd;
  52. {
  53.     return system(cmd);
  54. }
  55.  
  56. int userinit()
  57. {
  58.     install_null();    /* install device /dev/null or NUL: */
  59.     return 0;
  60. }
  61.  
  62. #ifdef HAS_SYSCALL
  63. int syscall()
  64. {
  65.   /* for now */
  66.   return 0;
  67. }
  68. #endif
  69.